<template>
	<view class="mcfxbox">
		<view class="topTotalBox">
			<view class="item">
				<view class="title">今日总分红</view>
				<text class="num">{{info.todayAmount || '0.00'}}</text>
			</view>
			<view class="item">
				<view class="title">今日均分红</view>
				<text class="num">{{info.todayAvgAmount || '0.00'}}</text>
			</view>
		</view>
		<view class="listWrap">
			
			<view class="listItem">
				<navigator url="/pages/data/merchat/merchatPolicy?userRank=1">
				  <text class="title">VIP会员>> </text>
					<view class="dataBox">
						<view class="lineData">
							<view class="info">
								<text class="num">{{info.rank1AllTotalAmount || '0.00'}}</text>
								<text class="name">累计分红总额</text>
							</view>
							<view class="info">
								<text class="num">{{info.rank1TotalAmount || '0.00'}}</text>
								<text class="name">今日分红总额</text>
							</view>
						</view>
						<view class="lineData">
							<view class="info">
								<text class="num">{{info.rank1UserNum || '0'}}</text>
								<text class="name">当前人数</text>
							</view>
							<view class="info">
								<text class="num">{{info.rank1AvgAmount || '0.00'}}</text>
								<text class="name">今日均分红总额</text>
							</view>
						</view>
					</view>
				</navigator>
			</view>
			
			<view class="listItem">
				<navigator url="/pages/data/merchat/merchatPolicy?userRank=2">
					<text class="title">创客会员>> </text>
					<view class="dataBox">
						<view class="lineData">
							<view class="info">
								<text class="num">{{info.rank2AllTotalAmount || '0.00'}}</text>
								<text class="name">累计分红总额</text>
							</view>
							<view class="info">
								<text class="num">{{info.rank2TotalAmount || '0.00'}}</text>
								<text class="name">今日分红总额</text>
							</view>
						</view>
						<view class="lineData">
							<view class="info">
								<text class="num">{{info.rank2UserNum || '0'}}</text>
								<text class="name">当前人数</text>
							</view>
							<view class="info">
								<text class="num">{{info.rank2AvgAmount || '0.00'}}</text>
								<text class="name">今日均分红总额</text>
							</view>
						</view>
					</view>
				</navigator>	
			</view>
			
			<view class="listItem">
				<navigator url="/pages/data/merchat/merchatPolicy?userRank=3">
					<text class="title">品牌会员>> </text>
					<view class="dataBox">
						<view class="lineData">
							<view class="info">
								<text class="num">{{info.rank3AllTotalAmount || '0.00'}}</text>
								<text class="name">累计分红总额</text>
							</view>
							<view class="info">
								<text class="num">{{info.rank3TotalAmount || '0.00'}}</text>
								<text class="name">今日分红总额</text>
							</view>
						</view>
						<view class="lineData">
							<view class="info">
								<text class="num">{{info.rank3UserNum || '0'}}</text>
								<text class="name">当前人数</text>
							</view>
							<view class="info">
								<text class="num">{{info.rank3AvgAmount || '0.00'}}</text>
								<text class="name">今日均分红总额</text>
							</view>
						</view>
					</view>
				</navigator>		
			</view>
			
			<view class="listItem">
				<navigator url="/pages/data/merchat/merchatPolicy?userRank=4">
					<text class="title">区代>> </text>
					<view class="dataBox">
						<view class="lineData">
							<view class="info">
								<text class="num">{{info.rank4AllTotalAmount || '0.00'}}</text>
								<text class="name">累计分红总额</text>
							</view>
							<view class="info">
								<text class="num">{{info.rank4TotalAmount || '0.00'}}</text>
								<text class="name">今日分红总额</text>
							</view>
						</view>
						<view class="lineData">
							<view class="info">
								<text class="num">{{info.rank4UserNum || '0'}}</text>
								<text class="name">当前人数</text>
							</view>
							<view class="info">
								<text class="num">{{info.rank4AvgAmount || '0.00'}}</text>
								<text class="name">今日均分红总额</text>
							</view>
						</view>
					</view>
				</navigator>	
			</view>
			
			<view class="listItem">
				<navigator url="/pages/data/merchat/merchatPolicy?userRank=5">
					<text class="title">市代>> </text>
					<view class="dataBox">
						<view class="lineData">
							<view class="info">
								<text class="num">**</text>
								<text class="name">累计分红总额</text>
							</view>
							<view class="info">
								<text class="num">**</text>
								<text class="name">今日分红总额</text>
							</view>
						</view>
						<view class="lineData">
							<view class="info">
								<text class="num">**</text>
								<text class="name">当前人数</text>
							</view>
							<view class="info">
								<text class="num">**</text>
								<text class="name">今日均分红总额</text>
							</view>
						</view>
					</view>
				</navigator>		
			</view>
			
			<view class="listItem">
				<navigator url="/pages/data/merchat/merchatPolicy?userRank=6">
					<text class="title">省代>> </text>
					<view class="dataBox">
						<view class="lineData">
							<view class="info">
								<text class="num">**</text>
								<text class="name">累计分红总额</text>
							</view>
							<view class="info">
								<text class="num">**</text>
								<text class="name">今日分红总额</text>
							</view>
						</view>
						<view class="lineData">
							<view class="info">
								<text class="num">**</text>
								<text class="name">当前人数</text>
							</view>
							<view class="info">
								<text class="num">**</text>
								<text class="name">今日均分红总额</text>
							</view>
						</view>
					</view>
				</navigator>		
			</view>
			
		</view>
	</view>
</template>

<script>
	import {getMerchatData} from '@/api/index.js'
	import user from "@/common/user.js"
	export default {
		data() {
			return {
				info:{}
			}
		},
		created() {
			this.getMerchatData()
		},
		methods: {
			async getMerchatData(){
				const res = await getMerchatData({userId:user.getUserId()})
				//console.log("RRRR:",res)
				this.info = res
			}
		}
	}
</script>

<style lang="scss" scoped>
	.mcfxbox{
		padding: 20rpx;
	}
	.topTotalBox{
		display: flex;
		height: 180rpx;
		background: url(https://iyouhaolife-1316622368.cos.ap-chongqing.myqcloud.com/h5/static/imgs/a1.png) no-repeat left top;
		background-size: 100% 100%;
		border-radius: 20rpx;
		.item{
			display: flex;
			flex-flow: column;
			justify-content: center;
			align-items: center;
			flex: 1;
			color: #fff;
			font-size: 30rpx;
			line-height: normal;
			.title{
				color: #d8d7da;
				padding: 0 0 20rpx 0;
			}
			.num{
				font-size: 34rpx;
				font-weight: bold;
			}
		}
	}
	.listWrap{
		font-size: 28rpx;
		.listItem{
			.title{
				display: block;
				padding:40rpx 0 20rpx 0;
				font-size: 30rpx;
			}
			.dataBox{
				box-sizing: border-box;
				width: 100%;
				background: #e0e2e5;
				border-radius: 20rpx;
				overflow: hidden;
				padding: 10rpx 0;
				.lineData{
					display: flex;
					height: 120rpx;
					line-height: normal;
					.info{
						display: flex;
						flex-flow: column;
						align-items: center;
						justify-content: center;
						flex: 1;
						line-height: 50rpx;
						.num{
							font-weight: bold;
							font-size: 34rpx;
							color: #f00021;
						}
					}
				}
			}
		}
	}
</style>
